##
# 笛卡尔积，由组合产生的列表
# 目的是产生列表
##
colors = ['black', 'white']
sizes = ['S', 'M', 'L']
tshirts = [(color, size) for color in colors for size in sizes]

if __name__ == '__main__':
    print(tshirts)
    for color in colors:
        for size in sizes:
            print((color, size))
    tshirts = [(size, color) for color in colors for size in sizes]
    print(tshirts)
    tshirts = [(color, size) for size in sizes for color in colors]
    print(tshirts)
    tshirts = [(size, color) for size in sizes for color in colors]
    print(tshirts)
